/*
 * @Description: 
 * @Author: mmzhang
 * @Date: 2021-12-15 17:16:17
 * @LastEditTime: 2023-01-12 14:43:42
 */
import Opt from '@/components/dt/info/Opt.js'
import ruleOpt from '@/biz/option/rule.js'
import tool from '@/common/tool.js'
import houseOpt from '@/biz/option/house.js'
import contractMgr from '@/biz/sales/contractOrder.js'

let _this = null
class SearchOpt extends Opt {

  constructor(vm) {
    _this = vm
    super()
    this.build()
  }

  build() {
    this.createAll()
    this.opts.push(...this.all)
  }


  createAll() {
    this.all = [
      {
        title: '签约状态',
        key: 'status',
        placeholder: '请选择',
        disabled: _this.countType != 0,
        select: {
          options: contractMgr.getContractStatus(),
          multiple: true,
          maxTagCount: 1
        },
      },
      {
        title: '产品类型',
        key: 'productTypes',
        placeholder: '请选择',
        disabled: _this.countType != 0,
        select: {
          multiple: true,
          maxTagCount: 1,
          key: 'productType',
        },
      },
      houseOpt.create({
        key: 'buildingId',
        disabled: _this.countType != 0,
        to: (info) => {
          return {
            buildingId: info.housesId,
            companyId: info.companyId,
            housesName: info.housesName
          }
        }
      })
    ]
  }
}

export default SearchOpt